/**
 * 
 */
package tests;

import junit.framework.TestCase;

import org.junit.After;
import org.junit.Before;

/**
 * Title: DevicesTest class for CSIS 343 Final Project 
 * Description: CS 343 Final Project - DevicesTest This class will test the Devices class 
 * 
 * @author Erik Olson
 * @email erik.olson-5@my.uwrf.edu
 * @author Mike Harmon
 * @email michael.harmon@my.uwrf.edu
 * @author Jack Friermuth
 * @email jack.friermuth@my.uwrf.edu
 * @author Luke Vang
 * @email luke.vang@my.uwrf.edu
 * @author Casey Golla
 * @email casey.golla@my.uwrf.edu
 * @date December 4th 2012
 */
public class DevicesTest extends TestCase {
	private static com.project.savelog.Devices devices_default;
	private static com.project.savelog.Devices devices_alternate;

	@Before
	public void setUp() throws Exception {
		//setting up 2 dummy objects
		devices_default = new com.project.savelog.Devices();
		devices_alternate =  new com.project.savelog.Devices( 1, "My Tablet" );
	}


	@After
	public void tearDown() throws Exception {
		//clearing objects out
		devices_default = null;
		devices_alternate = null;
	}

	/**
	 * Tests that the default constructor will set the correct defaults
	 * @Test
	 */
	public final void testDefaultConstructor() {
		assertEquals( devices_default.getDev_id(), 0, 0 );
		assertEquals( devices_default.getDev_name() , "" );
	}
	
	/**
	 * Tests that the alternate constructor will set the provided values
	 * @Test
	 */
	public final void testAlternateConstructor() {
		assertEquals( devices_alternate.getDev_id(), 1, 0 );
		assertEquals( devices_alternate.getDev_name() , "My Tablet" );
	}

	/**
	 * Tests that getDev_id will return the correct device id
	 * @Test
	 */
	public final void testGetDev_id() {
		assertEquals( devices_alternate.getDev_id(), 1, 0 );
	}

	/**
	 * Tests that setDev_id will correctly set the device id
	 * @Test
	 */
	public final void testSetDev_id() {
		devices_alternate.setDev_id( 2 );
		assertEquals( devices_alternate.getDev_id(), 2, 0 );
	}

	/**
	 * Tests that getDev_name will correctly get the device name
	 * @Test
	 */
	public final void testGetDev_name() {
		assertEquals( devices_alternate.getDev_name() , "My Tablet" );
	}

	/**
	 * Tests that setDev_name will correctly set the device name
	 * @Test
	 */
	public final void testSetDev_name() {
		devices_alternate.setDev_name( "My Phone" );
		assertEquals( devices_alternate.getDev_name() , "My Phone" );
	}

}
